package com.ly.system.auth;

import com.ly.config.response.Result;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import org.springframework.stereotype.Service;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Service("myLogoutSuccessHandler")
public class MyLogoutSuccessHandler extends JsonAuthentication implements LogoutSuccessHandler {//登出成功处理逻辑
    @Override
    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
        Result result= Result.ok().success(true);
        this.WriteJSON(response,request,result);

}
}
